<template>
  <div class="home">
    <div class="homeNav">
      <div class="home_sel">
        <select name="" id="sel_con">
          <option :class="{'color':'titleColor'}" value="gz">广州</option>
          <!-- <option value="sz">深圳</option> -->
        </select>
      </div>
      <div class="link">
        <div class="link_left" @click='toPlaying'  :class = "{'titleColor':num?true:false}">
          正在热映
        </div>
        <div class="link_right" @click="toComming" :class = "{'titleColor':num?false:true}">
          即将上映
        </div>
      </div>
      <div class="home_sou"><a href=""><i class="iconfont icon-search"></i></a></div>
    </div>
    <!-- home下的子路由  children -->
    <router-view />
  </div>
</template>

<script>
import '../scss/home.scss';
import '../css/iconfont.css';

export default {
  name: "home",
  data(){
    return {
      num:true,
    }
  },
  methods: {
    // 修改图片尺寸
    picFix(url){
      return url.replace('w.h','128.180');
    },
    // 跳转电影页
    toMovie(id){
      /* 当我点击的时候，跳转到movie页面，并且把movieId的id传过去 */
      this.$router.push({name:"movie",params:{ movieId : id } })
    },
    toPlaying(){
      console.log('hahah');
      this.num = true;
      this.$router.push({path:"/home/playing" })
    },
    toComming(){
      this.num = false;
      this.$router.push({path:"/home/comming" })
    }
  },
};
</script>
